Fully Qualified Name: | Laminas\Session\SaveHandler\MongoDB |
Implements: | SaveHandlerInterface |
MongoDB session save handler
Name | Description | Defined By |
---|---|---|
__construct() | Constructor | MongoDB |
close() | Close session | MongoDB |
destroy() | Destroy session | MongoDB |
gc() | Garbage collection | MongoDB |
open() | Open session | MongoDB |
read() | Read session data | MongoDB |
write() | Write session data | MongoDB |
Constructor
Parameter Name | Type | Description |
---|---|---|
$mongoClient | \MongoClient | |
$options | \MongoDBOptions |
Returns:
Close session
Returns: bool
Destroy session
Parameter Name | Type | Description |
---|---|---|
$id | string |
Returns: bool
Garbage collection
Note: MongoDB 2.2+ supports TTL collections, which may be used in place of this method by indexing the "modified" field with an "expireAfterSeconds" option. Regardless of whether TTL collections are used, consider indexing this field to make the remove query more efficient.
Parameter Name | Type | Description |
---|---|---|
$maxlifetime | int |
Returns: bool
Open session
Parameter Name | Type | Description |
---|---|---|
$savePath | string | |
$name | string |
Returns: bool
Read session data
Parameter Name | Type | Description |
---|---|---|
$id | string |
Returns: string
Write session data
Parameter Name | Type | Description |
---|---|---|
$id | string | |
$data | string |
Returns: bool